package com.crm.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.crm.mapper.DepositoryMapper;
import com.crm.pojo.CrmDepository;
import com.crm.service.DepositoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 仓库管理
 */
@Service
public class DepositoryServiceImpl extends ServiceImpl<DepositoryMapper,CrmDepository> implements DepositoryService {
    @Autowired
    private DepositoryMapper depositoryMapper;

    //添加
    @Override
    public int addDepository(CrmDepository crmDepository) {
        return depositoryMapper.insert(crmDepository);
    }

    //删除
    @Override
    public int delDepository(Integer dId) {
        return depositoryMapper.deleteById(dId);
    }

    //编辑
    @Override
    public int updateDepository(CrmDepository crmDepository) {
        return depositoryMapper.updateById(crmDepository);
    }

    //查询
    @Override
    public List<CrmDepository> selectDepository() {
        return depositoryMapper.selectList(null);
    }
}
